package test.viewmodel;

import model.User;

import org.zkoss.bind.annotation.BindingParam;
import org.zkoss.bind.annotation.Command;
import org.zkoss.bind.annotation.NotifyChange;
import org.zkoss.zk.ui.util.Clients;

public class UserDataVM {
	
	private UserDataModel userData;

	public UserDataVM() {
		userData = new UserDataModel();
	}
	
	public UserDataModel getUserData() {
		return userData;
	}
	
	@Command
    public void selectUser(@BindingParam("user") User selUser) {
		Clients.showNotification("Select "+selUser.getUsername(), "info", null, "middle_center", 1000);
    }

	@Command
	@NotifyChange("userData")
    public void delUser(@BindingParam("user") User selUser) {
		userData.removeUser(selUser);
    }
}
